<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .red{
      width: 400px;
      height: 400px;
      background-color: red;
    }
    .green{
      width: 300px;
      height: 300px;
      background-color: green;
    }
   .blue{
      width: 200px;
      height: 200px;
      background-color: blue;
    }
  </style>
</head>
<body>
  <div class="red">
    <div class="green">
      <div class="blue"></div>
    </div>
  </div>

  <script>
    let red = document.querySelector('.red')
    let green = document.querySelector('.green')
    let blue = document.querySelector('.blue')

    red.addEventListener('click', (e) => {
      console.log('red');
      // e.stopPropagation()
      e.stopImmediatePropagation()
    }, true)

    red.addEventListener('click', () => {
      console.log('red2');
    }, true)
    
    green.addEventListener('click', () => {
      console.log('green');
    }, true)

    blue.addEventListener('click', (e) => {
      console.log('blue')
    }, false)


  </script>
</body>
</html>